package com.nulldev.util.dataManagement.preferencesAPI;

import java.io.Closeable;
import java.io.IOException;
import java.util.Map;

public interface PreferenceInterface<T> extends Closeable {

	public T get(final String key);

	public boolean getAsBoolean(final String key);

	public boolean has(final String key);

	public void set(final String key, final T value);

	/**
	 * Clears the local cache of preferences, you'll need to either reload or
	 * rewrite the preferences.
	 */
	public void clear();

	public void reset() throws IOException;

	public void sync();

	public default Map<String, String> getAllOptions() {
		throw new UnsupportedOperationException("Cannot read all options!");
	}
}
